package com.hui.xiao.xiaohui.fragment;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.hui.xiao.xiaohui.R;

/**
 * Created by Administrator on 2016/5/27.
 */
public class BookDetailFragment extends Fragment {
    public static final String BOOK_ID = "book_id";
    BookContent.Book book;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        book = BookContent.bookMap.get(getArguments().get(BOOK_ID));
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.book_detail, container, false);
        ((TextView) rootView.findViewById(R.id.title)).setText(book.title);
        ((TextView) rootView.findViewById(R.id.desc)).setText(book.desc);
        return rootView;
    }
}
